﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BingMapsSample
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("地名を入力してください。");
            var inputName = Console.ReadLine();

            var query =
                from l in GetLocations()
                where l.Name == inputName
                select l;

            foreach (var l in query)
            {
                Console.WriteLine("{0}: {1}", l.Address, l.Point);
            }

            Console.WriteLine("終了するには Enter キーを入力してください。");
            Console.ReadLine();
        }

        static IQueryable<Location> GetLocations()
        {
            return new KQueryable<Location>(new LocationsQueryProvider());
        }
    }
}
